<?php
	require("../../DBops.php");
	session_start();
	
	$teamid=$_GET['teamid'];

	if(isset($_POST['selected_members']))
	{
		//echo $_POST['selected_members'];
		$arry = explode("__",$_POST['selected_members']);
		$con = connect("localhost", "root", "", "lab");

		$sql = "update personalinfo set projecteamID = 0 where projecteamID ='".$_GET['teamid']."' ";
		$result = mysql_query($sql, $con);
		//$count=mysql_num_rows($result);

		
				
		foreach($arry as $ID)
		{
			echo $ID."<br />";
			$sql = "update personalinfo set projecteamID = ".$_GET['teamid']." where ID = '$ID'";
			mysql_query($sql, $con);
		}
	}
	else
	{
		echo "<br />not isset";
	}
 echo"<script>location.href='TeamMember.php?teamid=$teamid'</script>";
?>